package com.heima.wemedia.mapper;

import com.heima.model.wemedia.pojos.WmMaterial;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface WmMaterialMapper {

    @Insert("insert into wm_material values(null,#{userId},#{url},#{type},#{isCollection},#{createdTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void save(WmMaterial wmMaterial);

    List<WmMaterial> findById(@Param("id") Integer id,@Param("isCollection") Short isCollection);

    List<WmMaterial> queryByList(@Param("urls") List<String> urls);
}
